<?php
namespace Home\Controller;
use Think\Controller;
class SortController extends Controller {
    public function index(){
        $sorts=D('Sort')->getAllSort();
        $this->assign('sorts_count',count($sorts));
        $this->assign('sorts',$sorts);
        $this->display(T('Home@Sort/index'));
    }
    public function detail(){
        $self_url=$_SERVER['PATH_INFO'];
        $id=explode(".",end(explode("/",$self_url)))['0'];
        $articles=D('Article')->getArticleBySortId($id);
//        dump($articles);
        $sort=D('Sort')->getSortById($id);
//        dump($sort);
//        dump($articles);
        $this->assign('articles',$articles);
        $this->assign('sort',$sort);
        $this->display(T('Home@Sort/detail'));
    }

}